package com.vunguyen.model;
// Generated Nov 29, 2014 7:36:58 AM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Congvandi generated by hbm2java
 */
@Entity
@Table(name="congvandi"
    ,catalog="qlkhoacntt"
)
public class Congvandi  implements java.io.Serializable {


     private String idCongVanDi;
     private Congvan congvan;
     private Set<CongvandiKhoaPhongban> congvandiKhoaPhongbans = new HashSet<CongvandiKhoaPhongban>(0);

    public Congvandi() {
    }

	
    public Congvandi(Congvan congvan) {
        this.congvan = congvan;
    }
    public Congvandi(Congvan congvan, Set<CongvandiKhoaPhongban> congvandiKhoaPhongbans) {
       this.congvan = congvan;
       this.congvandiKhoaPhongbans = congvandiKhoaPhongbans;
    }
   
     @GenericGenerator(name="generator", strategy="foreign", parameters=@Parameter(name="property", value="congvan"))@Id @GeneratedValue(generator="generator")

    
    @Column(name="idCongVanDi", unique=true, nullable=false, length=20)
    public String getIdCongVanDi() {
        return this.idCongVanDi;
    }
    
    public void setIdCongVanDi(String idCongVanDi) {
        this.idCongVanDi = idCongVanDi;
    }

@OneToOne(fetch=FetchType.EAGER)@PrimaryKeyJoinColumn
    public Congvan getCongvan() {
        return this.congvan;
    }
    
    public void setCongvan(Congvan congvan) {
        this.congvan = congvan;
    }

@OneToMany(fetch=FetchType.EAGER, mappedBy="congvandi")
    public Set<CongvandiKhoaPhongban> getCongvandiKhoaPhongbans() {
        return this.congvandiKhoaPhongbans;
    }
    
    public void setCongvandiKhoaPhongbans(Set<CongvandiKhoaPhongban> congvandiKhoaPhongbans) {
        this.congvandiKhoaPhongbans = congvandiKhoaPhongbans;
    }




}


